package com.bw.mallshop;

import android.database.sqlite.SQLiteDatabase;

import com.alibaba.android.arouter.launcher.ARouter;
import com.bw.greendao.dao.DaoMaster;
import com.bw.greendao.dao.DaoSession;
import com.bw.greendao.dao.DaoSessionUtils;
import com.bw.greendao.dao.UserEntityDao;
import com.bw.mvvm_common.BaseApplication;

/**
 * @author KK
 * @description:
 * @date :2021/10/13 15:17
 */
public class App extends BaseApplication {

    @Override
    public void onCreate() {
        super.onCreate();
        ARouter.openDebug();//开启Debug
        ARouter.openLog();//开启log打印日志
        ARouter.init(this);//开启ARouter

        //初始化
        DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(this, "Mallshop.db");
        SQLiteDatabase readableDatabase = devOpenHelper.getReadableDatabase();
        DaoMaster daoMaster = new DaoMaster(readableDatabase);
        DaoSession daoSession = daoMaster.newSession();
        DaoSessionUtils.getInstance().setSession(daoSession);


    }
}
